<%--
  Created by IntelliJ IDEA.
  User: 任
  Date: 2020/3/30
  Time: 10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>个人信息</title>
</head>
<link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/static/js/jquery-1.8.3.min.js">
<link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
<body>
<div  class="container" style="margin-top: 30px" >

    <h1 class="layui-container">售楼系统-个人信息</h1><br><br>

    <form  action="/update/user/id?id=${user.id}" method="post">

        <input type="hidden" id="id" name="id">

        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" value="${user.username}" name="username"  placeholder="请输入用户名"  class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-block">
                <input type="text" value="${user.phone}" name="phone"  placeholder="请输入电话"  class="layui-input">
            </div>
<%--            <div class="layui-form-mid layui-word-aux">辅助文字</div>--%>
        </div>
   <%--     <div class="layui-form-item">
            <label class="layui-form-label">选择框</label>
            <div class="layui-input-block">
                <select name="city" lay-verify="required">
                    <option value=""></option>
                    <option value="0">北京</option>
                    <option value="1">上海</option>
                    <option value="2">广州</option>
                    <option value="3">深圳</option>
                    <option value="4">杭州</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">复选框</label>
            <div class="layui-input-block">
                <input type="checkbox" name="like[write]" title="写作">
                <input type="checkbox" name="like[read]" title="阅读" checked>
                <input type="checkbox" name="like[dai]" title="发呆">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开关</label>
            <div class="layui-input-block">
                <input type="checkbox" name="switch" lay-skin="switch">
            </div>
        </div>--%>

        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" value="${user.name}" name="name"  placeholder="请输入姓名" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
              <%--  <c:if test="${user.sex=='男'}">
                   男 <input type="radio" name="sex" checked="checked"  value="男" id="male"/>&nbsp;&nbsp;<label for="male"></label>
                    <input type="radio" name="sex"   value="0" id="woman"/>&nbsp;&nbsp;<label for="woman">女</label>
                </c:if>

                <c:if test="${user.sex=='女'}">
                    <input type="radio" name="sex"   value="0" id="male"/>&nbsp;&nbsp;<label for="male">男</label>
                    女 <input type="radio" name="sex" checked="checked"  value="女" id="woman"/>&nbsp;&nbsp;<label for="woman"></label>
                </c:if>--%>
                  男  <input type="radio" name="sex" value="男" checked="${info.sex=='男'?"'checked'":''}"/>
                  女   <input type="radio" name="sex" value="女" checked="${info.sex==女?"'checked'":''}"/>

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="email" value="${user.email}" name="email" placeholder="请输入邮箱"  class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-block">
                <input type="text" name="age"   value="${user.age}"
                       placeholder="请输入年龄"  class="layui-input" >
            </div>
        </div>
        <div >
            <label class="layui-form-label">出生日期</label>
            <div class="layui-input-block">
                <input type="text" value="<fmt:formatDate value="${user.datatime}" pattern="yyyy-MM-dd" />"   name="datatime"
                      id="test1"
                       class="layui-input"placeholder="请输入出生日期">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <input type="text" value="${user.address}" name="address"  placeholder="请输入地址"  class="layui-input" >
            </div>
        </div>


       <%-- <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">文本域</label>
            <div class="layui-input-block">
                <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>--%>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" >完善信息</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                <button type="button" onclick="history.go(-1)" class="layui-btn layui-btn-primary">返回</button>
            </div>
        </div>
<%--        lay-submit lay-filter="formDemo"--%>
    </form>
</div>
</body>
</html>
<script src="/static/layui/layui.js"></script>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
    });
</script>